﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace DataModel.Models
{
    [Serializable]
    [DataContract]
    [JsonObject(MemberSerialization.OptIn)]
    public class SettingConfig
    {
        /// <summary>
        /// 是否总是询问退出
        /// </summary>
        [DataMember(IsRequired = true)]
        [JsonProperty(PropertyName = "isAlwaysAsk")]
        public bool IsAlwaysAsk { get; set; } = true;

        /// <summary>
        /// 壁纸仓库地址
        /// </summary>
        [DataMember(IsRequired = true)]
        [JsonProperty(PropertyName = "wallpaperHubPath")]
        public string WallpaperHubPath {  get; set; } = string.Empty;

        /// <summary>
        /// 壁纸仓库地址，新版模式
        /// </summary>
        [DataMember(IsRequired = true)]
        [JsonProperty(PropertyName = "wallpaperHubPathNew")]
        public string WallpaperHubPathNew { get; set; } = string.Empty;

        /// <summary>
        /// 播放设置
        /// </summary>
        [DataMember(IsRequired = true)]
        [JsonProperty(PropertyName = "playSetting")]
        public PlaySetting PlaySetting { get; set; } = new PlaySetting();

        /// <summary>
        /// 阿里云Oss配置
        /// </summary>
        [DataMember(IsRequired = true)]
        [JsonProperty(PropertyName = "oss")]
        public OssConfig OssConfig { get; set; } = new OssConfig();
    }

    [Serializable]
    [DataContract]
    [JsonObject(MemberSerialization.OptIn)]
    public class PlaySetting
    {
        /// <summary>
        /// 轮播间隔
        /// </summary>
        [DataMember(IsRequired = true)]
        [JsonProperty(PropertyName = "interval")]
        public int Interval { get; set; } = 60;
    }

}
